import React, { forwardRef, useState } from 'react'
import { Form, Input, Select, InputNumber, DatePicker,Cascader } from 'antd'
import moment from "moment";
import  city  from "@/utils/citydata"    
import 'moment/locale/zh-cn'
const { Option } = Select
const UserForm = forwardRef((props, ref) => {
  return (
    <Form
      ref={ref}
      title="horizontal"
      key={ref.id}
      labelAlign="left"
    >
      <div className='frombox'>
        {}
        <Form.Item
          name="id"
          label="id"
          rules={[{ required: true, message: '请输入id' }]}
        >
          <Input />
        </Form.Item>
        <Form.Item
          name="address"
          label="种植地点"
          rules={[{ required: true, message: '请输入地址' }]}
        >
           <Cascader options={city}  placeholder="请输入地址" />
          {}
        </Form.Item>
        <Form.Item
          name="title"
          label="管理员"
          rules={[{ required: true, message: '请输入管理员名字' }]}
        >
          <Input />
        </Form.Item>
        <Form.Item
          name="birth"
          label="新增时间"
          rules={[{ required: true, message: '请选择新增时间' }]}
        >
          <DatePicker
            inputReadOnly
            allowClear
          />
        </Form.Item>
        <Form.Item
          name="birth"
          label="修改时间"
          rules={[{ required: true, message: '请选择修改时间' }]}
        >
          <DatePicker
            inputReadOnly
            allowClear
          />
        </Form.Item>
      </div>
    </Form>
  )
})
export default UserForm